<template>
  <div>
    <h2>Page {{ id }}</h2>
    <el-input type="text" v-model="text" style="padding: 5px; font-size: 16px;" ></el-input>
    <el-input type="text" v-model="text2" style="padding: 5px; font-size: 16px;" :id="props.id + 'text2'"></el-input>

  </div>
</template>

<script setup>
import { ref, onBeforeUnmount, watch } from "vue";
import bus from "../libs/bus.js";

const props = defineProps({
  id: {
    type: Number,
    required: true
  }
})
const text = ref("");
const text2 = ref("")
const getText = () => {
  console.log("_id="+props.id+"  text=" + text.value + "   text2="+text2.value);
  return text.value;
}
const getId = () => {
  return props.id;
}

// 监听文本框的内容变化（可选）
watch(text, (newValue) => {
});
defineExpose({ getText, getId });

</script>